<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浮动</title>

    <style type="text/css">
        .out {
            width: 500px;
            height: 500px;
            border: 1px solid red;
        }

        .box1 {
            width: 100px;
            height: 100px;
            background: green;
            float: left;
        }

        .box2 {
            width: 200px;
            height: 200px;
            background: blue;
            float: left;
        }
    </style>
</head>
<body>
<div class="out">
    <div class="box1">box1</div>
    <div class="box2">box2</div>
</div>
</body>
</html>